//
//  WMEClubInformationModel.m
//  everyDay_duiTang
//
//  Created by 恩叔 on 16/2/26.
//  Copyright © 2016年 enshu. All rights reserved.
//

#import "WMEClubInformationModel.h"

@implementation WMEClubInformationModel
- (void)dealloc
{
    [_content release];
    [_senderName release];
    [_senderAvatar release];
    [_type release];
    [_repliesContent release];
    [_repliesSenderName release];
    [_repliesSenderAvatar release];
    
    [_selfId release];
    [_senderId release];
    [_like_count release];
    [_reply_count release];
    [_add_datetime_ts release];
    [_repliesId release];
    [_repliesT_comment_id release];
    [_repliesSenderId release];
    [_repliesAdd_datetime_ts release];
    
    [_visit_count release];
    
    [_recipientName release];
    [_recipientId release];
    
    [_photoPath release];
    [_topicUpdate release];
    [_isInClub release];
    [_dataId release];
    [_desc release];
    [_member_count release];
    [_tagTitle release];
    [_dataName release];
    [_weixinpengyouquan release];
    [_system release];
    [_weixin release];
    [_qzone release];
    [_qq release];
    [_weibo release];
    
    [_tagsString release];
    
    [_check_inhas_check release];
    [_check_inall_count release];
    [_check_incontinuous release];
    [_name release];
    [super dealloc];

}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    if ([key isEqualToString:@"id"]) {
        self.selfId = value;
    }
    if ([key isEqualToString:@"sender"]) {
        self.senderId = value[@"id"];
        self.senderAvatar = value[@"avatar"];
        self.senderName = value[@"username"];
    }
    if ([key isEqualToString:@"replies"]) {
        for (NSDictionary *temp in value) {
            self.repliesId = temp[@"id"];
            NSDictionary *dic = temp[@"sender"];
            self.repliesSenderId = dic[@"id"];
            self.repliesSenderAvatar = dic[@"avatar"];
            self.repliesSenderName = dic[@"username"];
            self.repliesContent = temp[@"content"];
            self.repliesAdd_datetime_ts = temp[@"add_datetime_ts"];
            self.repliesT_comment_id = temp[@"t_comment_id"];
        }
    }
    if ([key isEqualToString:@"recipient"]) {
        self.recipientName = value[@"username"];
        self.recipientId = value[@"id"];
    }
    
    if ([key isEqualToString:@"photo"]) {
        self.photoPath = value[@"path"];
    }
    if ([key isEqualToString:@"share_links_2"]) {
        self.weixinpengyouquan = value[@"weixinpengyouquan"];
        self.weixin = value[@"weixin"];
        self.system = value[@"system"];
        self.qzone = value[@"qzone"];
        self.qq = value[@"qq"];
        self.weibo = value[@"weibo"];
    }
   
    if ([key isEqualToString:@"check_in"]) {
        self.check_inall_count = value[@"all_count"];
        self.check_incontinuous = value[@"continuous"];
        self.check_inhas_check = value[@"has_check"];
    }
    if ([key isEqualToString:@"tags"]) {
        for (NSString *str in value) {
            self.tagsString = str;
        }
    }
    if ([key isEqualToString:@"photos"]) {
        for (NSDictionary *temp in value) {
            self.path = temp[@"path"];
            self.width = temp[@"width"];
            self.height = temp[@"height"];
        }
    }

}

@end
